package io.renren.modules.generator.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.generator.dao.TbMovieTypeDao;
import io.renren.modules.generator.entity.TbMovieTypeEntity;
import io.renren.modules.generator.service.TbMovieTypeService;

@Service("tbMovieTypeService")
public class TbMovieTypeServiceImpl extends ServiceImpl<TbMovieTypeDao, TbMovieTypeEntity>
        implements TbMovieTypeService {

    @Autowired
    private TbMovieTypeDao tbMovieTypeDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<TbMovieTypeEntity> page = this.page(
                new Query<TbMovieTypeEntity>().getPage(params),
                new QueryWrapper<TbMovieTypeEntity>()
        );

        return new PageUtils(page);
    }

    @Override public List<TbMovieTypeEntity> getAllList() {
        return tbMovieTypeDao.selectList(null);
    }

}